package com.cl.pattern.strategy.context;

import com.cl.pattern.strategy.PayStrategy;

/**
 * 上下文
 *
 * 选择策略的逻辑还是在程序，无法避免if else判断
 * @Description
 * @Author Small
 * @Date 2020/6/2 18:17
 * @Version 1.0
 **/
public class Context {
    private PayStrategy payment;

    public Context(PayStrategy strategy) {
        this.payment = strategy;
    }

    public void executePay() {
        payment.pay();
    }
}
